//
//  NewsDetialCell.m
//  B-72K
//
//  Created by 张春洋 on 16/3/18.
//  Copyright © 2016年 sos. All rights reserved.
//

#import "NewsDetialCell.h"


#import <Masonry.h>
@implementation NewsDetialCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self CreatData];
    }
    return self;
    
}
- (void)CreatData
{
    UIImageView *tu = [UIImageView new];
    [self.contentView addSubview:tu];
    _tu = tu;
    UILabel *title = [UILabel new];
    [self.contentView addSubview:title];
    _title = title;
    _title.numberOfLines = 0;
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    __weak __typeof(&*self)weakSelf = self;
    
    [self.tu mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(100);
        make.width.mas_equalTo(100);
        make.top.equalTo(weakSelf.mas_top).offset(0);
        make.left.equalTo(weakSelf.mas_left).offset(5);
    }];
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.tu.mas_right).offset(5);
        make.top.equalTo(weakSelf.mas_top).offset(10);
        make.right.equalTo(weakSelf.mas_right).offset(-10);
        make.bottom.equalTo(weakSelf.mas_bottom).offset (-5);
        
    }];

    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
